<?php
include_once 'conn.php';
$goods_info = [];
$sql = $db ->query(
  'SELECT goods_id,goods_title,goods_url,goods_type,goods_price FROM goods ORDER BY RAND() LIMIT 0,7');
while ($row = $sql -> fetch_assoc()) {
  array_push($goods_info,$row);
}
echo json_encode($goods_info);
$db -> close();
?>
